$(function (){
    var url = window.location.href;
    var urlsplit = url.split("/");
    var len = urlsplit.length;
    var idstr = urlsplit[len-1];
    $.ajax({
        url: "http://localhost:8080/api/student/get/" + idstr,
        method:"get",
        success:function (rs) {
            if(rs.code>=0){
                data=rs.data;
                $("#id").val(data.id);
                $("#no").val(data.no);
                $("#name").val(data.name);
                $("#password").val("");
                $("#sex").val(data.sex);
                $("#age").val(data.age);
                $("#score").val(data.score);
            }else {
                alert(rs.msg);
            }
        },
        error: function(jqXHR, textStatus, errorThrown) {
            console.log("Error: " + errorThrown);
        }
    })
})